<template>
  <h2>我是孙子</h2>
  <div>爷爷说: {{ word }}</div>
  <div>我爸说: {{ say }}</div>
</template>

<script setup lang='ts'>
import { ref, reactive, inject } from 'vue'
import type {Ref} from 'vue'   // 引入Ref类型，为了给inject中指定类型

let say = inject<Ref<string>>('say')

let word = inject<Ref<string>>('word')
    

</script>
<style scoped>
</style>